#ifndef ORGDAO_H
#define ORGDAO_H

#include <QtSql/QSqlDatabase>
#include <QJsonObject>
#include <QJsonArray>

class OrgDao
{
public:
    explicit OrgDao(QSqlDatabase& db);

    static QJsonArray getAllOrgList(QSqlDatabase& db);
    static QJsonObject getOrgPage(QSqlDatabase& db, QJsonObject sysOrgPageParam);
    static int removeByIds(QSqlDatabase& db, QJsonArray sysOrgIdParamList);
    static QStringList getAllDescendantIds(QSqlDatabase& db, const QString& parentId);
private:
    QSqlDatabase& db_; // 非拥有引用
};

#endif // ORGDAO_H
